The ShinyStudio project is an orchestration of various open-source solutions with the goal of providing:
The ShinyStudio ecosystem includes:
Each component of the stack is run in a Docker container for reproducibility, scalability, and security. Only the NGINX port is exposed on the host system; all communication between ShinyProxy and other components happens inside an isolated Docker network.
The ShinyStudio “stack” includes the ShinyStudio image, which builds upon the rocker/verse image on DockerHub.
While this guide focuses on the stack, spin up the image in Bash or PowerShell with these commands:
Bash (Linux/Mac)
docker network create shinystudio-net && \
docker run --rm -it \
--network shinystudio-net \
-v /var/run/docker.sock:/var/run/docker.sock \
-e USERID=$UID \
-e USER=$USER \
-e PASSWORD=password \
-e CONTENT_PATH="${HOME}/ShinyStudio/content" \
-e SITE_NAME=shinystudio \
-p 80:8080 \
-e TAG=latest \
dm3ll3n/shinystudio:latest
PowerShell
docker network create shinystudio-net;
docker run --rm -it `
--network shinystudio-net `
-v /var/run/docker.sock:/var/run/docker.sock `
-e USERID=1000 `
-e USER=$([environment]::UserName) `
-e PASSWORD=password `
-e CONTENT_PATH="/host_mnt/c/Users/$([environment]::UserName)/ShinyStudio/content" `
-e SITE_NAME=shinystudio `
-p 80:8080 `
-e TAG=latest `
dm3ll3n/shinystudio:latest
Notice the unique form of the path for the
CONTENT_PATHvariable required when in a Windows environment.
PreReqs:
# copy the setup files from version branch 0.5.0
git clone -b 0.5.0 https://github.com/dm3ll3n/ShinyStudio
# enter the directory.
cd ShinyStudio
# run certify to generate self-signed cert.
## Bash users run:
bash ./certify.sh
## Powershell users run:
pwsh ./certify.ps1
Important! As a crucial first step, log in to the job scheduler at
https://<hostname>:8443using the usernameadminand passwordadministrator. Once in, go into settings and set a unique password.
Now, browse to http://<hostname> (e.g., http://localhost) to access ShinyStudio. On first launch, you will need to accept the warning about an untrusted certificate. See the customized setup to see how to request a trusted cert from LetsEncrypt.
The default logins are below.
| username | password |
|---|---|
| user | user |
| dev | developer |
| admin | administrator |
Customized setup checklist:
Pre-Setup
git clone -b 0.5.0 https://github.com/dm3ll3n/ShinyStudio.git myShinyStudiogit checkout -b mastergit remote set-url origin https://github.com/<username>/myShinyStudio.gitgit pushapplication.yml.envnginx.confbash certify.sh *or* pwsh certify.ps1Post-Setup
https://<hostname>:8443, change password.The files essential to a customized configuration are described in more detail below:
.env
Note that Docker volume names are renamed along with the project name, so be prepared to migrate or recreate data stored in Docker volumes when changing the project name.The docker-compose environment file. The project name, content path, and HTTP ports can be changed here.
application.yml
The ShinyProxy config file. Users can be added/removed here. Other configurations are available too, such as the site title and the ability to provide a non-standard landing page.
Using the provided template, you can assign users to the following groups with tiered access:
nginx.conf
The NGINX config file. Defines the accepted site name and what ports to listen on.
If you change the ports here, you must also change the ports defined in the .env file. Also, if you change the domain name, you must provide/generate a new certificate for it.
certify.sh
The script used to generate a self-signed cert, or to request a trusted cert from LetsEncrypt.
With no parameters, certify generates a self-signed cert for example.com (the default domain name defined in nginx.conf).
To generate a self-signed cert with another domain name, first edit the domain name in nginx.conf. Afterward, generate a new cert with:
bash ./certify.sh <domain>
# e.g., bash ./certify.sh www.shinystudio.com
If your server is accessible from the web, you can request a trusted certificate from LetsEncrypt. First, edit nginx.conf with your domain name, then request a new cert from LetsEncrypt like so:
bash ./certify.sh <domain> <email>
# e.g., bash ./certify.sh www.shinystudio.com you@email.com
CertBot will automatically renew your LetsEncrypt certificate.
To manage the services in the stack, use the native docker-compose commands, e.g.:
# stop all services.
docker-compose down
# start all services.
docker-compose up -d
Open either RStudio or VS Code and notice two important directories:
Files must be saved in either of these two directories in order to persist between sessions.
These two folders are shared between instances RStudio, VS Code, and Shiny Server. So, creating new content is as simple as saving a file to the appropriate directory.
The ShinyStudio image comes with…
…and ODBC drivers for:
These are persistent because they are built into the image.
| Persistent | |
|---|---|
| __ShinyStudio__ directory | Yes |
| __Personal__ directory | Yes |
| Other directories | No |
| Python (conda) Enviroments | Yes |
| Python Packages | Yes |
| R Libraries | Yes |
| PowerShell Modules | Yes |
| RStudio User Settings | Yes |
| VS Code User Settings | Yes |
| Installed Apps | No, unless installed with conda |
| Installed Drivers | No |